<?php

$strScreenName = 'EnterStaff';
$strQueryName = 'qryAddStaff';
$strFormName = 'frmEnterStaff';

     if (($intStaffID) && (!$strReprocessing)) {
             include (MODULE . "/action/qrySelectStaff");
             $cboID = stripslashes($myrow["ID"]);
             $cboTitle = stripslashes($myrow["Title"]);
             $txtFirstName = stripslashes($myrow["FirstName"]);
             $txtSurname = stripslashes($myrow["Surname"]);
             $txtAddress1 = stripslashes($myrow["Address1"]);
             $txtAddress2 = stripslashes($myrow["Address2"]);
             $txtCity = stripslashes($myrow["City"]);
             $txtPostalCode = stripslashes($myrow["PostalCode"]);
             $cboCountry = stripslashes($myrow["Country"]);
             $txtPhone = stripslashes($myrow["Phone"]);
             $txtEmail = stripslashes($myrow["Email"]);
             $txtFax = stripslashes($myrow["Fax"]);
             $txtPassword = stripslashes($myrow["Password"]);
         }else{
     }
echo "
<tr>
     <td>
         <table  width='450' cellpadding='0' cellspacing='0' border='0' class='Normal' align='center'>
     <tr align='left'>
         <td align='left' colspan='2'>
             <H2>Enter Staff</H2>
         </td>
     </tr>
";
// Upploaded = 0
echo (StartForm($strScreenName, "post", $strQueryName,array('intStaffID'=>$intStaffID,'strReprocessing'=>'True'),"","",$strFormName,"","return frmEnterStaff_onsubmit()"));

echo "
     <tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images".SITE_SUFFIX."/save.gif' alt='Save'>
         </td>
     </tr>
";
//  Type                 4
//  atrributes           17
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        
//  SourceField          ID
//  Required             False
//  Type                 4
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Title
//  SourceField          Title
//  Required             True
echo "
     <tr align='left'>
         <td align='left'>
             <b>Title :&nbsp;</b>
         </td>
         <td align='right'>";
             CreateDropDown("cboTitle", "SELECT * FROM tblTitle ORDER BY 2", "", $cboTitle);
echo "
             <a href='".ScreenURL("EnterTitle")."' target='_blank'>+</a>
         </td>
     </tr>
";
//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        First Name
//  SourceField          FirstName
//  Required             True
echo "
     <tr>
         <td align='left' colspan='1'>
             <b>First Name :&nbsp;</b>
         </td>
         <td align='right' colspan='1'>
           <input type=\"text\" name=\"txtFirstName\" value = \"$txtFirstName\" size= \"15\" maxlength=\"15\">
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Surname
//  SourceField          Surname
//  Required             True
echo "
     <tr>
         <td align='left' colspan='1'>
             <b>Surname :&nbsp;</b>
         </td>
         <td align='right' colspan='1'>
           <input type=\"text\" name=\"txtSurname\" value = \"$txtSurname\" size= \"18\" maxlength=\"18\">
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Address
//  SourceField          Address1
//  Required             True
echo "
     <tr>
         <td align='left' colspan='2'>
             <b>Address :&nbsp;</b><br/>
             <div align='right'>
             <input type=\"text\" name=\"txtAddress1\" value = \"$txtAddress1\" size= \"60\" maxlength=\"60\"></div>
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        
//  SourceField          Address2
//  Required             False
echo "
     <tr>
         <td align='left' colspan='2'>
             <b> :&nbsp;</b><br/>
             <div align='right'>
             <input type=\"text\" name=\"txtAddress2\" value = \"$txtAddress2\" size= \"60\" maxlength=\"60\"></div>
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        City
//  SourceField          City
//  Required             False
echo "
     <tr>
         <td align='left' colspan='2'>
             <b>City :&nbsp;</b><br/>
             <div align='right'>
             <input type=\"text\" name=\"txtCity\" value = \"$txtCity\" size= \"60\" maxlength=\"60\"></div>
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Post Code
//  SourceField          PostalCode
//  Required             False
echo "
     <tr>
         <td align='left' colspan='1'>
             <b>Post Code :&nbsp;</b>
         </td>
         <td align='right' colspan='1'>
           <input type=\"text\" name=\"txtPostalCode\" value = \"$txtPostalCode\" size= \"20\" maxlength=\"20\">
         </td>
     </tr>
";

//  Type                 4
//  atrributes           1
//  AllowZeroLength      False
//  Default Value        2
//  Validate Rule        
//  Validate Text        Country
//  SourceField          Country
//  Required             False
echo "
     <tr align='left'>
         <td align='left'>
             <b>Country :&nbsp;</b>
         </td>
         <td align='right'>";
             CreateDropDown("cboCountry", "SELECT * FROM tblCountry ORDER BY 2", "", $cboCountry);
echo "
             <a href='".ScreenURL("EnterCountry")."' target='_blank'>+</a>
         </td>
     </tr>
";
//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Phone Number
//  SourceField          Phone
//  Required             False
echo "
     <tr>
         <td align='left' colspan='2'>
             <b>Phone Number :&nbsp;</b><br/>
             <div align='right'>
             <input type=\"text\" name=\"txtPhone\" value = \"$txtPhone\" size= \"35\" maxlength=\"35\"></div>
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Email
//  SourceField          Email
//  Required             False
echo "
     <tr>
         <td align='left' colspan='2'>
             <b>Email :&nbsp;</b><br/>
             <div align='right'>
             <input type=\"text\" name=\"txtEmail\" value = \"$txtEmail\" size= \"40\" maxlength=\"40\"></div>
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Fax Number
//  SourceField          Fax
//  Required             False
echo "
     <tr>
         <td align='left' colspan='1'>
             <b>Fax Number :&nbsp;</b>
         </td>
         <td align='right' colspan='1'>
           <input type=\"text\" name=\"txtFax\" value = \"$txtFax\" size= \"20\" maxlength=\"20\">
         </td>
     </tr>
";

//  Type                 10
//  atrributes           2
//  AllowZeroLength      False
//  Default Value        
//  Validate Rule        
//  Validate Text        Password
//  SourceField          Password
//  Required             True
echo "
     <tr>
         <td align='left' colspan='1'>
             <b>Password :&nbsp;</b>
         </td>
         <td align='right' colspan='1'>
           <input type=\"password\" name=\"txtPassword\" ' size= \"30\" maxlength=\"30\">
         </td>
     </tr>
";

echo "
     <tr>
         <td align='right' colspan='2'>
             <input type='image' src='./images".SITE_SUFFIX."/save.gif' alt='Save'>
         </td>
     </tr>
         </table
     </form>
     </td>
 </tr>
";
     //$strListAll = "true";
       //include (MODULE . "/screen/ListStaff");
?>
<script language="JavaScript">
<!--
function frmEnterStaff_onsubmit() 
{


     if(document.frmEnterStaff.txtFirstName.value == "") {
         alert("Please enter First Name");
         document.frmEnterStaff.txtFirstName.focus();
         document.frmEnterStaff.txtFirstName.select();
         return(false);
     }

     if(document.frmEnterStaff.txtSurname.value == "") {
         alert("Please enter Surname");
         document.frmEnterStaff.txtSurname.focus();
         document.frmEnterStaff.txtSurname.select();
         return(false);
     }

     if(document.frmEnterStaff.txtAddress1.value == "") {
         alert("Please enter Address");
         document.frmEnterStaff.txtAddress1.focus();
         document.frmEnterStaff.txtAddress1.select();
         return(false);
     }

     if(document.frmEnterStaff.txtPassword.value == "") {
         alert("Please enter Password");
         document.frmEnterStaff.txtPassword.focus();
         document.frmEnterStaff.txtPassword.select();
         return(false);
     }


}
// -->
</script>
